-
-
Notifications
You must be signed in to change notification settings - Fork 18
Inflection 134 Use std::unique_ptr to avoid delete #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| auto tokenizer = new Tokenizer(TOKENIZER_CONSTRUCTORS[mid].construct(locale, systemConfig)); | ||
| // Initialize the data loading and caches so that it doesn't possibly fail later. | ||
| delete npc(tokenizer)->createTokenChain(u"initialization"); | ||
| ::std::unique_ptr<TokenChain> unused(npc(tokenizer)->createTokenChain(u"initialization")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original was actually correct. There is no intermediate line between getting the object and deleting it. I recommend leaving this one alone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I can take this out
|
PTAL |
|
I think the only remaining change needed is the Inflector.hpp change to make the destructor public is needed. |
|
Changed according to comments. PTAL |
* Use std::unique_ptr to avoid delete * Remove change to warm up code * Make destructor public instead of adding friend
#134